<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head>
    <head th:include="header :: header"></head>
    <title>数据开发</title>
    <style>
        .form-horizontal{
            width: unset;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showTable">
        <div class="grid-btn">

            <a class="btn btn-primary" @click="reload"><i class="fa fa-refresh"></i>&nbsp;刷新</a>

            <a shiro:hasPermission="sys:user:save" class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>

            <a shiro.hasPermission="sys:user:update" class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>

            <a shiro.hasPermission="sys:user:delete" class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="showInfo" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
														
                    <div class="form-group">
                        <div class="col-sm-2 control-label">工作名称</div>
                        <div class="col-sm-10">
                            <input maxlength="50" type="text" class="form-control" v-model="develop.name" placeholder="工作名称"/>
                        </div>
                    </div>
											
                    <div class="form-group">
                        <div class="col-sm-2 control-label">资源分组</div>
                        <div class="col-sm-10">
                            <select class="form-control" v-model="develop.spaceId" disabled>
                                <option v-for="option in spaceList" v-bind:value="option.id">{{option.name}}</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-2 control-label">数据源</div>
                        <div class="col-sm-10">
                            <input style="width: 100%;float: left" id="developDb" type="text" v-model="develop.developDb" class="form-control" placeholder="开发数据源"
                                   inputfromopen
                                   vModelFullPath="vm.develop.developDb"
                                   valueField="id"
                                   displayField="name"
                                   queryPageUrl="/datasource/database/list?spaceId={spaceId}"
                                   selectCallbackFn="getSelectedRowData"
                                   layerOption="{content:ctx+'modules/datasource/database.html?type=1'}"/>
                            <label style="color: red;">支持数据源：Mysql</label>
                        </div>
                    </div>
											
                    <div class="form-group">
                        <div class="col-sm-2 control-label">sql执行脚本</div>
                        <div class="col-sm-10">
                            <input maxlength="16777215" readonly type="text" class="form-control" v-model="develop.sqlScript" placeholder="sql执行脚本"/>
                        </div>
                    </div>
											
                    <div class="form-group">
                        <div class="col-sm-2 control-label">创建时间</div>
                        <div class="col-sm-10">
                            <input maxlength="" readonly type="text" class="form-control" v-bind:value="develop.createTime" placeholder="创建时间"/>
                        </div>
                    </div>
											
                    <div class="form-group">
                        <div class="col-sm-2 control-label">修改时间</div>
                        <div class="col-sm-10">
                            <input maxlength="" readonly type="text" class="form-control" v-bind:value="develop.updateTime" placeholder="修改时间"/>
                        </div>
                    </div>
											
                    <div class="form-group">
                        <div class="col-sm-2 control-label">创建人</div>
                        <div class="col-sm-10">
                            <input maxlength="" readonly type="text" class="form-control" v-bind:value="develop.createUser" placeholder="创建人"/>
                        </div>
                    </div>
											
                    <div class="form-group">
                        <div class="col-sm-2 control-label">修改人</div>
                        <div class="col-sm-10">
                            <input maxlength="" readonly type="text" class="form-control" v-bind:value="develop.updateUser" placeholder="修改人"/>
                        </div>
                    </div>
							            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" id="btnSaveOrUpdate" data-loading-text="保存中..." @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>

    <div v-show="showDevelopWork" class="panel panel-default" id="devWorkDiv" style="width: 100%;float: left;position: absolute">
        <div class="panel-heading" style="padding: 2px 15px;height: 36px;">
            <div>
                <div style="float: left;padding-top: 7px">【SQL脚本开发】</div>
                <div style="float: right">
                    <input type="button" class="btn btn-primary" @click="executeJob" value="执行调度"/>
                    <input type="button" class="btn btn-success" @click="bindJob" value="调度配置"/>
                    <input type="button" class="btn btn-info" @click="executeLog" value="执行日志"/>
                    <input type="button" class="btn btn-warning" @click="devWorkCancel()" value="返回"/>
                </div>
            </div>
        </div>
        <iframe style="height: 95%;width: 100%;" id="devWorkIFrame" th:src="@{/modules/dataworks/develop_work.html}"></iframe>
    </div>

    <div th:replace="modules/xxljob/jobinfoAdd.html">

    </div>
</div>
<script th:src="@{/statics/js/modules/dataworks/develop.js}"></script>
<script th:src="@{/statics/plugins/diy/bindFromOpen.js}"></script>
</body>
</html>